cmake_minimum_required(VERSION 3.15)
project(PelcoDSmoothServer LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(Boost 1.70 REQUIRED COMPONENTS system)

add_executable(pelco_d_server_simulator
    src/main.cpp
    src/pelco_d_server.hpp
    src/pelco_d_smooth_128ms_5s.hpp
)

target_compile_definitions(pelco_d_server_simulator PRIVATE
    _WIN32_WINNT=0x0601   # Windows 7 及以上
)

target_include_directories(pelco_d_server_simulator PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/src
    ${Boost_INCLUDE_DIRS}
)

target_link_libraries(pelco_d_server_simulator
    Boost::system
)

target_compile_options(pelco_d_server_simulator PRIVATE
    $<$<CXX_COMPILER_ID:GNU,Clang>:-Wall -Wextra -pedantic>
)

install(TARGETS pelco_d_server_simulator DESTINATION bin)